package com.woniu.market_stall_web.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.market_stall_web.entity.Stall;
import com.woniu.market_stall_web.mapper.StallMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StallService {

    @Autowired
    StallMapper stallMapper ;


    public PageInfo<Stall> showRecommend(Integer now, Integer size) {
        PageHelper.startPage(now, size);
        List<Stall> list = stallMapper.showRecommend();
        return new PageInfo<>(list);
    }

    public PageInfo<Stall> showAllRent(Integer now, Integer size) {
        PageHelper.startPage(now, size);
        List<Stall> list = stallMapper.showAllRent();
        return new PageInfo<>(list);
    }

    public Stall showThisRent(int sid) {
        return stallMapper.selectByPrimaryKey(sid);
    }
}
